<template>
	<view>
		<u-form labelPosition="left" :model="form" ref="uForm" label-width="200rpx">
			<u-form-item label="物料编码:" prop="name" borderBottom>
				<u-input v-model="form.name" placeholder="请选择" :border="border" type="select" @click="show1 = true"></u-input>
				<u-select v-model="show1" :list="list" @confirm="confirm1"></u-select>
			</u-form-item>
			<u-form-item label="物料名称:" prop="name1" borderBottom><u-input v-model="form.name1" placeholder="" :border="border"></u-input></u-form-item>
			<u-form-item label="单位:" prop="name" borderBottom><u-input v-model="form.name" placeholder="" :border="border"></u-input></u-form-item>
			<u-gap height="20" bg-color="#dedede"></u-gap>
			<u-form-item label="仓库:" prop="name" borderBottom>
				<u-input v-model="form.name" placeholder="请选择" :border="border" type="select" @click="show2 = true"></u-input>
				<u-select v-model="show2" :list="list" @confirm="confirm2"></u-select>
			</u-form-item>
			<u-form-item label="库区:" prop="name" borderBottom><u-input v-model="form.name" placeholder="" :border="border"></u-input></u-form-item>
			<u-form-item label="库位:" prop="name" borderBottom><u-input v-model="form.name" placeholder="" :border="border"></u-input></u-form-item>
			<u-gap height="20" bg-color="#dedede"></u-gap>
			<u-form-item label="入库数量:" prop="name" borderBottom><u-input v-model="form.name" placeholder="请输入数量" :border="border"></u-input></u-form-item>
			<u-form-item label="批次:" prop="name" borderBottom><u-input v-model="form.name" placeholder="请输入批次号" :border="border"></u-input></u-form-item>
		</u-form>
		<u-row gutter="32" class="bottom-box" justify="center">
			<u-col span="10">
				<view><u-button type="primary" shape="circle" @click="handleSave()">保存</u-button></view>
			</u-col>
		</u-row>
	</view>
</template>
<script>
export default {
	data() {
		return {
			form: {
				name: ''
			},
			border: false,
			show1: false,
			show2: false,
			list: [
				{
					value: '1',
					label: '华为'
				},
				{
					value: '2',
					label: '苹果'
				}
			]
		};
	},
	methods: {
		handleSave() {
			uni.navigateTo({
				url: '/pages/sys/home/components/work_bench/buy-store/buy_store'
			});
		},
		confirm1() {},
		confirm2() {},
		handleSearch() {},
		resetForm(formName) {
			this.$refs[formName].resetFields();
		}
	},
	onReady() {
		//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
		this.$refs.uForm.setRules(this.rules);
	}
};
</script>

<style lang="scss" scoped>
.u-form {
	padding: 0 40rpx;
}
.buttons {
	margin-top: 50rpx;
	display: flex;
	justify-content: space-between;
}
</style>
